<script>
  import { ElMessage } from 'element-plus'
  import { ref } from 'vue'
  import { ElTable } from 'element-plus'
  import {Search} from "@element-plus/icons-vue";
  export default {
    computed: {
      Search() {
        return Search
      }
    },
    components:{
      Search
    },
    data() {
      return {
        formLabelWidth: '140px',
        activeIndex: 1,
        //tableData:[],
        selectedRows: [],
        queryFrm: {
          userid: ''            //学生姓名对象和班级查询对象
          //goodsname:"",
          // goodsprice:0
        },
        //学生信息列表
        CommentData: []
      }
    },
    methods: {
      btnShowUpdate(goodsinfo) {
        console.log(goodsinfo);
      },
      onSubmit() {
        console.log(this.queryFrm)
        this.LoadCommentData()
      },
      LoadCommentData() {
        this.$http.get("http://localhost:8080/comment/query", {
          params: {
            id: this.queryFrm.userid
          }
        })
          .then((res) => {
            console.log(res.data)
            this.CommentData = res.data;
            console.log(this.CommentData);
          }).catch(function (err) {
            console.log(err);
          })
      }
    },
    mounted() {
        this.LoadCommentData()
      }
  }
</script>
<template>
    <div class="card-header">
      <span>
        <h2 class="card-title">信誉管理</h2>
      </span>
    </div>

      <!-- <el-header>
        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
          <el-menu-item index="1">返回首页</el-menu-item>
        </el-menu>
        <div class="h-6" ></div>

      </el-header> -->

      <el-main>
        <el-form :inline="true" :model="queryFrm" class="demo-form-inline">
          <el-form-item label="卖家id">
            <el-input v-model="queryFrm.userid" placeholder="" clearable />
          </el-form-item>
          <el-form-item>
            <el-button default type="primary" :icon="Search" @click="onSubmit">搜索</el-button>
          </el-form-item>
        </el-form>
        <el-table :data="CommentData" stripe style="width: 100%">
          <!-- <el-table ref="multipleTableRef" :data="CommentData" style="width: 100%"
          @selection-change="handleSelectionChange"> -->
          <!-- <el-form-item>
            <el-button type="primary" @click="onSubmit">搜索</el-button>
          </el-form-item> -->

          <el-table-column type="selection" width="55" />
          <el-table-column  label="序号"  type = "index" width="100" />
          <el-table-column property="user_id" label="卖家id" width="100" />
          <el-table-column property="user_name" label="卖家名称" show-overflow-tooltip />
          <el-table-column property="goods_mark" label="宝贝质量评分" width="110" />
          <el-table-column property="logistics_mark" label="物流速度评分" width="110" />
          <el-table-column prop="service_mark" label="服务保障评分" width="110" />
          <el-table-column property="status" label="星级" width="80" />
          <el-table-column fixed="right" label="操作" width="200">
           
            <el-button default type="danger" size="small">
              降级
            </el-button>
          </el-table-column>
        </el-table>
        <!-- <div style="margin-top: 20px">
          <el-button @click="toggleSelection([tableData[1], tableData[2]])">
            Toggle selection status of second and third rows
          </el-button>
          <el-button @click="toggleSelection()">Clear selection</el-button>
        </div> -->
      </el-main>

  
</template>
<style>


</style>